<?php

// +----------------------------------------------------------------------
use think\facade\Route;


Route::group('api', function () {
    // 用户相关路由
    Route::group('user', function () {
        Route::post('register', 'User/register');
        Route::post('login', 'User/login');
    });

    // 目标相关路由
    Route::group('goal', function () {
        Route::post('create', 'Goal/createGoal');
    });

    // 任务相关路由
    Route::group('task', function () {
        Route::post('assign', 'Task/assignTask');
    });

    // 进度日志相关路由
    Route::group('progress-log', function () {
        Route::post('log', 'ProgressLog/logProgress');
    });

    // 奖惩相关路由
    Route::group('reward-punishment', function () {
        Route::post('add', 'RewardPunishment/addRewardPunishment');
    });

    // 小组相关路由
    Route::group('group', function () {
        Route::post('create', 'PeerGroup/createGroup');
        Route::post('join', 'PeerGroup/joinGroup');
    });

    // 习惯相关路由
    Route::group('habit', function () {
        Route::post('create', 'Habit/createHabit');
        Route::post('log', 'Habit/logHabit');
    });

    // 挑战相关路由
    Route::group('challenge', function () {
        Route::post('create', 'Challenge/createChallenge');
        Route::post('join', 'Challenge/joinChallenge');
    });

    // 数据分析和报告相关路由
    Route::group('report', function () {
        Route::get('user', 'Report/user'); // 生成用户报告
        Route::get('group', 'Report/group'); // 生成小组报告
    });

    // 提醒相关路由
    Route::group('reminder', function () {
        Route::post('create', 'ReminderController/create'); // 创建提醒
        Route::get('list', 'ReminderController/list'); // 获取提醒列表
        Route::post('delete', 'ReminderController/delete'); // 删除提醒
        Route::post('update', 'ReminderController/update'); // 更新提醒
    });

});

